[C] this code, its work fine and return what i want, but its hangs before print it ??
Posted
by Rami Jarrar
on Stack Overflow
See other posts from Stack Overflow
or by Rami Jarrar
Published on 2010-03-27T17:19:16Z
Indexed on
2010/03/27
18:03 UTC
Read the original article
Hit count: 283
I make this program ::
#include<stdio.h>
char *raw_input(char *msg);
main() {
char *s;
*s = *raw_input("Message Here Is: ");
printf("Return Done..");
printf(s);
}
char *raw_input(char *msg){
char *d;
printf("%s", msg);
scanf("%s",&d);
return d;
}
What this do is, it print my message and scan for input from the user, then print it,, but whats the problem in print the input from the user ???
Update::
I need the raw_input func. call be like this without any extra
*s = *raw_input("Message Here");
I dont want to use this ::
raw_input("Message Here Is: ", d);
....
Just want to return the string that the user will enter .
© Stack Overflow or respective owner